//
//  NSString+Add.h
//  AtCar
//
//  Created by 代佳宏 on 2020/11/25.
//  Copyright © 2020 车一转. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSString (Add)

- (CGSize)sizeForFont:(UIFont *)font size:(CGSize)size mode:(NSLineBreakMode)lineBreakMode;

- (CGFloat)widthForFont:(UIFont *)font;

- (CGFloat)heightForFont:(UIFont *)font width:(CGFloat)width;


/// 把分转成元字符串
/// @param cents 分
+ (NSString *)changeMoneyFromCents:(NSInteger)cents;

/// 把分转成折扣字符串
/// @param cents 分
+ (NSString *)changeDiscountFromCents:(NSInteger)cents;

/// 把元转成分
- (NSInteger)changeToCents;
/// 拼接URL后面的参数
/// @param params 参数
- (NSString *)appendUrlParams:(NSDictionary *)params;

/// url里面的中文处理
- (NSString *)encodeUrlChinese;

@end

NS_ASSUME_NONNULL_END
